package com.hdjk.view.callback;

import com.hdjk.view.entity.RedeemFee;
import com.lst.projectlib.entity.Msg;

import org.json.JSONObject;

import okhttp3.Response;

/**
 * Created by Administrator on 2017/11/22.
 */

public abstract class GetRedeemTransactionFeeCallBack extends MsgCallBack {
    @Override
    public Msg parseNetworkResponse(Response response, int i) throws Exception {
        Msg msg = super.parseNetworkResponse(response, i);
        JSONObject object = (JSONObject) msg.getData();
        if (object != null) {
            RedeemFee redeemFee = new RedeemFee();
            if (!object.isNull("totalRedemptionCharge"))
                redeemFee.setRedemptionCharge(object.getString("totalRedemptionCharge"));

            msg.setData(redeemFee);
        }

        return msg;
    }
}
